class ScheduleEventsController < ApplicationController
  def index
    @schedule_events = ScheduleEvent.all
  end

  def show
    @schedule_event = ScheduleEvent.find(params[:id])
  end

  def new
    @schedule_event = ScheduleEvent.new
  end

  def create
    @schedule_event = ScheduleEvent.new(params[:schedule_event])
    if @schedule_event.save
      redirect_to @schedule_event, :notice => "Successfully created schedule event."
    else
      render :action => 'new'
    end
  end

  def edit
    @schedule_event = ScheduleEvent.find(params[:id])
  end

  def update
    @schedule_event = ScheduleEvent.find(params[:id])
    if @schedule_event.update_attributes(params[:schedule_event])
      redirect_to @schedule_event, :notice  => "Successfully updated schedule event."
    else
      render :action => 'edit'
    end
  end

  def destroy
    @schedule_event = ScheduleEvent.find(params[:id])
    @schedule_event.destroy
    redirect_to schedule_events_url, :notice => "Successfully destroyed schedule event."
  end
end
